Semiconductor device and method for controlling the same

ABSTRACT

A semiconductor device according to an exemplary aspect of the invention is capable of being selectively switched between an oscillation circuit and a signal input-output circuit, and includes first and second external connecting terminals that are connectable to an oscillation device; an inverting amplifier an input side of which is electrically connected to the first external connecting terminal through a coupling capacitor and an output side of which is electrically connected to the second external connecting terminal; a feedback resistor connected to the input side and the output side of the inverting amplifier; a bias stabilization circuit that stabilizes a bias applied to the coupling capacitor; a first signal input-output portion connected to the first external connecting terminal; and a second signal input-output portion connected to the second external connecting terminal.

INCORPORATION BY REFERENCE

This application is based upon and claims the benefit of priority fromJapanese patent application No. 2009-222330, filed on Sep. 28, 2009, thedisclosure of which is incorporated herein in its entirety by reference.

BACKGROUND

1. Field of the Invention

The present invention relates to a semiconductor device and a method forcontrolling the same, and more particularly, to a semiconductor devicecapable of being selectively switched between an oscillation circuit anda signal input-output circuit, and a method for controlling the same.

2. Description of Related Art

Oscillation circuits that generate a clock for a CPU or a timer areroughly classified into a built-in oscillation circuit and a crystaloscillation circuit that requires an external component. The built-inoscillation circuit requires no external component, which read to areduction in cost. However, in general, the frequency accuracy of thebuilt-in oscillation circuit is low. On the other hand, the crystaloscillation circuit has a high frequency accuracy, though it requiresthe external component (a crystal oscillation device). For this reason,the crystal oscillation circuit is usually used for a clock generationcircuit for a timer. Recently, many of general-purpose ICs such as amicrocomputer implement both the built-in oscillation circuit and thecrystal oscillation circuit. Thus, those circuits can be selectivelyused by using software.

A circuit that implements both the built-in oscillation circuit and thecrystal oscillation circuit is capable of selectively using thosecircuits in such a way that a CPU is operated by the high speed built-inoscillation circuit when high performance is needed, and the crystaloscillation circuit is used for an operation (a timer operation) in astandby state, for example. Some microcomputers are used for the timeroperation in most of the lifecycle, depending on the environment inwhich the microcomputers are used. Therefore, a reduction in powerconsumption of the crystal oscillation circuit is very beneficial forthe microcomputers.

Meanwhile, common components have been widely used for themicrocomputers to achieve the low cost. In particular, pads for an I/Obuffer of the microcomputer need to be shared due to their manyfunctions, because the number of pins and areas are restricted. Thecrystal oscillation circuit that requires the external crystaloscillation device uses at least two pads. Therefore, it is important toshare the pads.

Since the crystal oscillation circuit requires the external component, aleakage current and a parasitic capacitance are generated and cause biasfluctuation, which leads to decreased oscillation stability. To solvethese problems, an oscillation circuit disclosed in Japanese UnexaminedPatent Application Publication No. 2004-96711 implements a DC-cuttingcapacitor for cutting a DC bias at an input terminal of the oscillationcircuit.

FIG. 6 is a diagram illustrating the oscillation circuit disclosed inJapanese Unexamined Patent Application Publication No. 2004-96711. Asshown in FIG. 6, the oscillation circuit disclosed in JapaneseUnexamined Patent Application Publication No. 2004-96711 includes acrystal oscillator 110 serving as an oscillating source, and a maincircuit portion 120 which is connected to the crystal oscillator 110through a signal path and which is oscillated and driven. The maincircuit portion 120 is formed as a semiconductor device, and both endsof the crystal oscillator 110 are connected to input-output terminalsXin and Xout of the signal path.

The main circuit portion 120 includes an inverter 122 that is connectedto the crystal oscillator 110 through the input-output terminals Xin andXout; a feedback resistor 124; and a DC-cutting capacitor 126 that is anelement galvanically, or in a DC manner, isolating the signal pathprovided between an input side of the inverter 122 and the inputterminal Xin of the signal path. Electrostatic protection circuits 140-1and 140-2 are provided to signal lines on the input-output terminals Xinand Xout sides of the main circuit portion 120, thereby preventing anysurge voltage that intrudes from the exterior from intruding into themain circuit portion 120. In this case, Cy1 and Cy2 denote parasiticcapacitances of diodes. Cg and Cd denote capacitances on the inputterminal side and the output terminal side of the crystal oscillator110, respectively. In addition, Cx denotes a parasitic capacitance ofthe DC-cutting capacitor 126.

If the DC-cutting capacitor 126 is provided within the circuit, as inthe case of the oscillation circuit disclosed in Japanese UnexaminedPatent Application Publication No. 2004-96711, the potential of theinput terminal Xin of the crystal oscillator 110 is close to an openstate and the input terminal potential is unstable. Any change in thepotential of the input terminal Xin of the crystal oscillator 110changes each depletion layer of the parasitic capacitances Cy1, Cy2, andCx connected to the input terminal Xin, so that the capacitance alsochanges. Therefore, if a slight leakage occurs at the input terminal Xinof the crystal oscillator 110 due to an external disturbance such as anincrease of humidity or light, and the potential of the input terminalXin changes, the parasitic capacitances also change accordingly. Sincethe oscillation frequency of the oscillation circuit also changes as aresult of such a change in the parasitic capacitances, a problem occursin that it becomes difficult to obtain stable oscillation.

To solve the above-mentioned problems, a potential stabilization circuit150 is provided at the input terminal Xin side of the crystal oscillator110 in the oscillation circuit disclosed in Japanese Unexamined PatentApplication Publication No. 2004-96711. In this case, bias resistors 160and 162 are used for the potential stabilization circuit 150. The biasresistor 160 is connected between the input terminal Xin side and aconstant voltage Vreg side, and the bias resistor 162 is connectedbetween the input terminal Xin side and a reference potential Vss side.This configuration makes it possible to suppress an unstable oscillationeven if the leakage occurs at the pad for connecting to the external inthe oscillation circuit disclosed in Japanese Unexamined PatentApplication Publication No. 2004-96711.

SUMMARY

In the oscillation circuit disclosed in Japanese Unexamined PatentApplication Publication No. 2004-96711, a DC bias can be determined bypulling up and down using the bias resistors 160 and 162. When theoscillation circuit disclosed in Japanese Unexamined Patent ApplicationPublication No. 2004-96711 is used for a specific use such as a timer,the input-output terminals (Xin and Xout) of the IC configuring such anoscillation circuit are provided as dedicated terminals.

The present inventors have found problems as described below. When ageneral-purpose IC such as a microcomputer implements such anoscillation circuit, the input-output terminals (Xin and Xout) of the ICare shared between the input and output of other signals. Since the biasresistors 160 and 162 are provided in the oscillation circuit disclosedin Japanese Unexamined Patent Application Publication No. 2004-96711,the leakage current flows through the bias resistors 160 and 162 whenthe input-output terminals (Xin and Xout) are shared between the inputand output of the crystal oscillator and the input and output of thedigital I/O. As a result, the output level fluctuates due to the leakagecurrent in the digital I/O. This causes a problem that malfunctionfrequency occurs and the power consumption increases.

A first exemplary aspect of the present invention is a semiconductordevice capable of being selectively switched between an oscillationcircuit and a signal input-output circuit, including: first and secondexternal connecting terminals that are connectable to an oscillationdevice; an inverting amplifier, an input side of the inverting amplifierbeing electrically connected to the first external connecting terminalthrough a coupling capacitor, an output side of the inverting amplifierbeing electrically connected to the second external connecting terminal;a feedback resistor connected to the input side and the output side ofthe inverting amplifier; a bias stabilization circuit that stabilizes abias applied to the coupling capacitor; a first signal input-outputportion connected to the first external connecting terminal; and asecond signal input-output portion connected to the second externalconnecting terminal, wherein when the semiconductor device is used asthe oscillation circuit, the inverting amplifier and the biasstabilization circuit are brought into an operating state and the firstand second signal input-output portions are brought into a non-operatingstate, and when the semiconductor device is used as the signalinput-output circuit, the inverting amplifier and the bias stabilizationcircuit are brought into the non-operating state and the first andsecond signal input-output portions are brought into the operatingstate.

The semiconductor device according to the first exemplary aspect of thepresent invention is configured to be capable of being selectivelyswitched between the oscillation circuit and the signal input-outputcircuit. This makes it possible to share the signal input-output portionand reduce the number of input-output terminals. Further, when thesemiconductor device is used as the signal input-output circuit, it ispossible to prevent signals from flowing into the inverting amplifier orthe bias stabilization circuit as a leakage current. This results insuppression of the occurrence of malfunction due to the output levelfluctuation and reduction in power consumption.

A second exemplary aspect of the present invention is a method forcontrolling a semiconductor device capable of being selectively switchedbetween an oscillation circuit and a signal input-output circuit, thesemiconductor device including: first and second external connectingterminals that are connectable to an oscillation device; an invertingamplifier, an input side of the inverting amplifier being electricallyconnected to the first external connecting terminal through a couplingcapacitor, an output side of the inverting amplifier being electricallyconnected to the second external connecting terminal; a feedbackresistor connected to the input side and the output side of theinverting amplifier; a bias stabilization circuit that stabilizes a biasapplied to the coupling capacitor; a first signal input-output portionconnected to the first external connecting terminal; and a second signalinput-output portion connected to the second external connectingterminal, and the method including: bringing the inverting amplifier andthe bias stabilization circuit into an operating state and bringing thefirst and second signal input-output portions into a non-operating statewhen the semiconductor device is used as the oscillation circuit, andbringing the inverting amplifier and the bias stabilization circuit intothe non-operating state and bringing the first and second signalinput-output portions into the operating state when the semiconductordevice is used as the signal input-output circuit.

The method for controlling the semiconductor device according to thesecond exemplary aspect of the present invention can selectively use theoscillation circuit and the signal input-output circuit. This makes itpossible to share the signal input-output portion and reduce the numberof input-output terminals. Further, when the semiconductor device isused as the signal input-output circuit, it is possible to preventsignals from flowing into the inverting amplifier or the biasstabilization circuit as a leakage current. This results in suppressionof the occurrence of malfunction due to the output level fluctuation andreduction in power consumption.

According to exemplary aspects of the present invention, it is possibleto provide a semiconductor device capable of being selectively switchedbetween an oscillation circuit and a signal input-output circuit, and amethod for controlling the same.

BRIEF DESCRIPTION OF THE DRAWINGS

The above and other exemplary aspects, advantages and features will bemore apparent from the following description of certain exemplaryembodiments taken in conjunction with the accompanying drawings, inwhich:

FIG. 1 is a circuit diagram showing a semiconductor device according toa first exemplary embodiment;

FIG. 2 is a diagram illustrating a unit for controlling thesemiconductor device according to the first exemplary embodiment;

FIG. 3 is a circuit diagram showing a semiconductor device according toa second exemplary embodiment;

FIG. 4 is a circuit diagram showing a semiconductor device according toa third exemplary embodiment;

FIGS. 5A to 5D are diagrams illustrating operations of the semiconductordevice according to the first to third exemplary embodiments; and

FIG. 6 is a diagram illustrating an oscillation circuit disclosed inJapanese Unexamined Patent Application Publication No. 2004-96711.

DETAILED DESCRIPTION OF THE EXEMPLARY EMBODIMENTS First ExemplaryEmbodiment

A first exemplary embodiment of the present invention will be describedbelow with reference to the accompanying drawings. FIG. 1 is a circuitdiagram showing a semiconductor device according to the first exemplaryembodiment. As shown in FIG. 1, the semiconductor device according tothis exemplary embodiment includes a first external connecting terminal(X1) 2 and a second external connecting terminal (X2) 3 that areconnectable to an oscillation device 1; an inverting amplifier 4 aninput side of which is electrically connected to the first externalconnecting terminal (X1) 2 through a coupling capacitor (Cox) 11 and anoutput side of which is electrically connected to the second externalconnecting terminal (X2) 3; a feedback resistor (Rfb) 5 connected to theinput side and the output side of the inverting amplifier 4; a biasstabilization circuit 6 that stabilizes a bias applied to the couplingcapacitor (Cox) 11 connected to the input side of the invertingamplifier 4; a first signal input-output portion 7 that is connected tothe first external connecting terminal (X1) 2; and a second signalinput-output portion 8 that is connected to the second externalconnecting terminal (X2) 3.

The semiconductor device according to this exemplary embodiment iscapable of being selectively switched between an oscillation circuit anda signal input-output circuit. When the semiconductor device accordingto this exemplary embodiment is used as the oscillation circuit, theinverting amplifier 4 and the bias stabilization circuit 6 are broughtinto an operating state and the first and second signal input-outputportions 7 and 8 are brought into a non-operating state. When thesemiconductor device according to this exemplary embodiment is used asthe signal input-output circuit, the inverting amplifier 4 and the biasstabilization circuit 6 are brought into the non-operating state and thefirst and second signal input-output portions 7 and 8 are brought intothe operating state. Hereinafter, the configuration of the semiconductordevice according to this exemplary embodiment is described in detail.

When the semiconductor device according to this exemplary embodiment isused as the oscillation circuit, the oscillation device 1 is connectedto the first external connecting terminal (X1) 2 and the second externalconnecting terminal (X2) 3. For example, the oscillation device 1 is acrystal oscillator. Further, the first external connecting terminal (X1)2 is connected to a power supply terminal (a second power supplyterminal) supplied with a ground potential VSS (typically 0 V) through acapacitor CG. The second external connecting terminal (X2) 3 isconnected to the power supply terminal (the second power supplyterminal) supplied with the ground potential VSS through a capacitor CD.

Further, the first external connecting terminal (X1) 2 is connected tothe input side of the inverting amplifier 4 through the couplingcapacitor (Cox) 11 that is provided to cut a DC component. The secondexternal connecting terminal (X2) 3 is connected to the output side ofthe inverting amplifier 4. The feedback resistor (Rfb) 5 is providedbetween the input side and the output side of the inverting amplifier 4.

For example, when the coupling capacitor (Cox) 11 is configured by agate capacitor, the coupling capacitor (Cox) 11 depends on the biasbecause the gate capacitor depends on the bias. In the semiconductordevice according to this exemplary embodiment, the bias stabilizationcircuit 6 that stabilizes the bias applied to the coupling capacitor(Cox) 11 is provided in consideration of the coupling capacitor (Cox) 11depending on the bias.

For example, the bias stabilization circuit 6 shown in FIG. 1 includes aPMOS transistor (a first transistor) 21, a pull-up resistor PU (a firstresistor) 22, a pull-down resistor PD (a second resistor) 24, an NMOStransistor (a second transistor) 23, and an inverter 25. In the PMOStransistor 21, the source is connected to a power supply terminal (afirst power supply terminal) supplied with a power supply voltage VDD,the gate is connected to an output side of the inverter 25, and thedrain is connected to one end of the pull-up resistor 22.

One end of the pull-up resistor 22 is connected to the drain of the PMOStransistor 21, and the other end of the pull-up resistor 22 is connectedto one end of the coupling capacitor (Cox) 11 and one end of thepull-down resistor 24. One end of the pull-down resistor 24 is connectedto one end of the coupling capacitor (Cox) 11 and the other end of thepull-up resistor 22, and the other end of the pull-down resistor 24 isconnected to the drain of the NMOS transistor 23. In the NMOS transistor23, the drain is connected to the other end of the pull-down resistor24, the gate is connected to a node supplied with an ENB_OSC signal 64,and the source is connected to the power supply terminal (the secondpower supply terminal) supplied with the ground potential VSS. An inputside of the inverter 25 is connected to the node supplied with theENB_OSC signal 64.

The bias applied to the coupling capacitor (Cox) 11 can be determined bythe resistance ratio between the pull-up resistor 22 and the pull-downresister 24. That is, the output voltage from the bias stabilizationcircuit 6 is expressed by Rpd/(Rpu+Rpd)×VDD, where Rpu is a resistancevalue of the pull-up resistor 22 and Rpd is a resistance value of thepull-down resistor 24.

Further, in the semiconductor device according to this exemplaryembodiment, the circuit is mounted on the same semiconductor substrateexcept for the oscillation device 1, for example, and the oscillationdevice 1 can be externally connected to the first external connectingterminal (X1) 2 and the second external connecting terminal (X2) 3. Insuch configuration, a leakage current may be generated at the firstexternal connecting terminal (X1) 2 or the second external connectingterminal (X2) 3 due to an increase of humidity or light, or the circuitmay be damaged due to a surge voltage. In the semiconductor deviceaccording to this exemplary embodiment, an electrostatic protectioncircuit 10 may be implemented at the first external connecting terminal(X1) 2 to prevent such phenomenon from occurring.

The electrostatic protection circuit 10 includes an NMOS transistor (athird transistor) 26 and an NMOS transistor (a fourth transistor) 27.The gate and drain of the NMOS transistor 26 are connected to the powersupply terminal (the first power supply terminal) supplied with thepower supply voltage VDD, and the source of the NMOS transistor 26 isconnected to the first external connecting terminal (X1) 2. The drain ofthe NMOS transistor 27 is connected to the first external connectingterminal (X1) 2, and the gate and source of the NMOS transistor 27 areconnected to the power supply terminal (the second power supplyterminal) supplied with the ground potential VSS.

The first signal input-output portion 7 is connected to the firstexternal connecting terminal (X1) 2. When the semiconductor deviceaccording to this exemplary embodiment is used as the signalinput-output circuit, a signal supplied from the first externalconnecting terminal (X1) 2 can be sent to an internal circuit throughthe first signal input-output portion 7. Further, a signal supplied fromthe internal circuit can be output from the first external connectingterminal (X1) 2 through the first signal input-output portion 7. Each ofthe first external connecting terminal (X1) 2 and the first signalinput-output portion 7 functions as a digital I/O in the semiconductordevice according to this exemplary embodiment.

Further, a buffer 13 may be provided at the output side of the invertingamplifier 4. A signal that has an oscillation frequency generated at theoscillation circuit is output from the buffer 13. Furthermore, anyelectrostatic protection circuit may be provided at the second externalconnecting terminal (X2) 3. Any electrostatic protection circuit may beused, as long as the electrostatic protection circuit protects theinternal circuit from the leakage current or the surge voltage generatedat the second external connecting terminal (X2) 3.

The second signal input-output portion 8 is connected to the secondexternal connecting terminal (X2) 3. When the semiconductor deviceaccording to this exemplary embodiment is used as the signalinput-output circuit, a signal supplied from the second externalconnecting terminal (X2) 3 can be sent to the internal circuit throughthe second signal input-output portion 8. Further, a signal suppliedfrom the internal circuit can be output from the second externalconnecting terminal (X2) 3 through the second signal input-outputportion 8. Each of the second external connecting terminal (X2) 3 andthe second signal input-output portion 8 functions as a digital I/O inthe semiconductor device according to this exemplary embodiment.

Next, a control of the semiconductor device according to this exemplaryembodiment will be described. FIG. 2 is a diagram illustrating a unitfor controlling the semiconductor device according to this exemplaryembodiment. The unit shown in FIG. 2 includes a nonvolatile memory 50, aCPU 51, and an internal register 52. The CPU 51 is connected to thenonvolatile memory 50 and the internal register 52.

The internal register 52 and the first external connecting terminal (X1)2 are connected to each other through the first signal input-outputportion 7. The first signal input-output portion 7 includes buffers 53and 54. The internal register 52 is supplied with a DATA_IN_X1 signalfrom the first external connecting terminal (X1) 2 through the buffer53. The internal register 52 outputs a DATA_OUT_X1 signal to the firstexternal connecting terminal (X1) 2 through the buffer 54. The internalregister 52 outputs an ENB_OUT_buffer signal 61 that turns on or off thefunction of the buffer 54. to the buffer 54.

Similarly, the internal register 52 and the second external connectingterminal (X2) 3 are connected to each other through the second signalinput-output portion 8. The second signal input-output portion 8includes buffers 55 and 56. The internal register 52 is supplied with aDATA_IN_X2 signal from the second external connecting terminal (X2) 3through the buffer 56. The internal register 52 outputs a DATA_OUT_X2signal to the second external connecting terminal (X2) 3 through thebuffer 55. The internal register 52 outputs an ENB_OUT_buffer signal 62that turns on or off the function of the buffer 55, to the buffer 55.

The internal register 52 outputs an ENB_OSC signal 64 to the invertingamplifier 4 and the buffer 13. The buffer 13 outputs an OSC_IN signal(that corresponds to an OSC_OUT signal 63 shown in FIG. 1) to theinternal register 52. The internal register 52 outputs the ENB_OSCsignal 64 to the inverter 25 of the bias stabilization circuit 6 shownin FIG. 1. The internal register 52 may control the inverting amplifier4 or the buffers 13, 54, and 55 to be brought into the operating stateor the non-operating state. The nonvolatile memory 50 may store thecontrol information.

Next, operations of the semiconductor device according to this exemplaryembodiment are explained with reference to FIGS. 1 and 2. Thesemiconductor device according to this exemplary embodiment is capableof being selectively switched between the oscillation circuit and thesignal input-output circuit. First, the case where the semiconductordevice is used as the oscillation circuit is described.

When the semiconductor device is used as the oscillation circuit, theinternal register 52 shown in FIG. 2 outputs the ENB_OSC signal 64 tothe inverting amplifier 4 and the buffer 13. The ENB_OSC signal 64brings the inverting amplifier 4 and the buffer 13 into the operatingstate.

Further, the internal register 52 outputs the ENB_OUT_buffer signal 61to the buffer 54. The ENB_OUT_buffer signal 61 brings the buffer 54 ofthe first signal input-output portion 7 into the non-operating state.This makes it possible to prevent the DATA_OUT_X1 signal from flowinginto the input side of the inverting amplifier 4 from the internalregister 52. Similarly, the internal register 52 outputs theENB_OUT_buffer signal 62 to the buffer 55. The ENB_OUT_buffer signal 62brings the buffer 55 of the second signal input-output portion 8 intothe non-operating state. This makes it possible to prevent theDATA_OUT_X2 signal from flowing into the output side of the invertingamplifier 4 from the internal register 52. As mentioned above, thesemiconductor device according to this exemplary embodiment can preventunnecessary signals from flowing into the oscillation circuit from theinternal register 52 when the semiconductor device is used as theoscillation circuit.

The internal register 52 outputs the ENB_OSC signal 64 to the biasstabilization circuit 6. The ENB_OSC signal 64 brings the biasstabilization circuit 6 into the operating state. For example, theinternal register 52 outputs a high level signal as the ENB_OSC signal64 to the bias stabilization circuit 6 to bring the bias stabilizationcircuit 6 shown in FIG. 1 into the operating state. When the high levelsignal is supplied to the gate of the NMOS transistor 23, the pull-downresistor 24 and the power supply terminal (the second power supplyterminal) that is supplied with the ground potential VSS are connected.Further, when the high level signal is supplied to the input side of theinverter 25, the inverter 25 outputs a low level signal. Then, the lowlevel signal is supplied to the gate of the PMOS transistor 21, and thepull-up resistor 22 and the power supply terminal (the first powersupply terminal) that is supplied with the power supply voltage VDD areconnected.

As a result, the power supply terminal (the first power supply terminal)that is supplied with the power supply voltage VDD, the pull-up resistor22, the pull-down resistor 24, and the power supply terminal (the secondpower supply terminal) that is supplied with the ground potential VSSare connected in series and function as the bias stabilization circuit6. An output voltage Rpd/(Rpu+Rpd)×VDD that is determined by theresistance ratio between the pull-up resistor 22 and the pull-downresister 24 is supplied to the coupling capacitor (Cox) 11.

As mentioned above, when the semiconductor device according to thisexemplary embodiment is used as the oscillation circuit, the oscillationdevice 1 is connected to the first external connecting terminal (X1) 2and the second external connecting terminal (X2) 3 to bring theinverting amplifier 4 and the buffer 13 into the operating state.Further, the bias stabilization circuit 6 supplies the couplingcapacitor (Cox) 11, which cuts the DC component, with the output voltagethat is determined by the resistance ratio between the pull-up resistor22 and the pull-down resister 24. As a result, the semiconductor deviceaccording to this exemplary embodiment functions as the oscillationcircuit, and outputs from the buffer 13 the OSC_OUT signal 63 that isthe output signal with a predetermined frequency. The OSC_OUT signal 63(illustrated as the OSC_IN signal 63 in FIG. 2) output from the buffer13 is supplied to the internal register 52. In this case, the internalregister 52 brings the buffers 54 and 55 into the non-operating state.Therefore, it is possible to prevent the unnecessary signal from flowinginto the oscillation circuit from the first signal input-output portion7 or the second signal input-output portion 8. This results in animprovement in the accuracy of the oscillation circuit.

FIG. 5A is a diagram illustrating a voltage value at the second externalconnecting terminal (X2) 3 when the semiconductor device according tothis exemplary embodiment is used as the oscillation circuit. As shownin FIG. 5A, the voltage at the second external connecting terminal (X2)3 oscillates at the predetermined frequency between the power supplyvoltage VDD and the ground potential VSS. Note that a DC bias at thesecond external connecting terminal (X2) 3 is determined by a self-biasof the inverting amplifier 4 and the feedback resistor (Rfb) 5.

FIG. 5B is a diagram illustrating a voltage value at the first externalconnecting terminal (X1) 2 when the semiconductor device according tothis exemplary embodiment is used as the oscillation circuit. As shownin FIG. 5B, the voltage at the first external connecting terminal (X1) 2oscillates at the predetermined frequency between the power supplyvoltage VDD and the ground potential VSS. In this case, the voltageoscillates with the output voltage Rpd/(Rpu+Rpd)×VDD of the biasstabilization circuit 6 as a center.

Next, the case where the semiconductor device is used as the signalinput-output circuit is described. When the semiconductor device is usedas the signal input-output circuit, the internal register 52 shown inFIG. 2 outputs the ENB_OSC signal 64 to the inverting amplifier 4 andthe buffer 13. The ENB_OSC signal 64 brings the inverting amplifier 4and the buffer 13 into the non-operating state. For example, theinverting amplifier 4 can be configured by a clocked inverter. In thiscase, the clocked inverter is brought into the non-operating state.Further, the output side of the inverting amplifier 4 is made to be highimpedance, for example. This makes it possible to prevent the signaloutput from the second external connecting terminal (X2) 3 to the secondsignal input-output portion 8, or the signal output from the secondsignal input-output portion 8 to the second external connecting terminal(X2) 3, from flowing into the inverting amplifier 4 or the buffer 13. Inthis case, a resistance value of the feedback resistor (Rfb) 5 that isconnected to the output side and the input side of the invertingamplifier 4 is so high that it is possible to prevent these signals fromflowing into the inverting amplifier 4 or the buffer 13 through thefeedback resistor (Rfb) 5. For example, the resistance value of thefeedback resistor (Rfb) 5 is in a range of about 10 MΩ to 20 MΩ.

Further, the internal register 52 outputs the ENB_OUT_buffer signal 61to the buffer 54. The ENB_OUT_buffer signal 61 brings the buffer 54 ofthe first signal input-output portion 7 into the operating state.Similarly, the internal register 52 outputs the ENB_OUT_buffer signal 62to the buffer 55. The ENB_OUT_buffer signal 62 brings the buffer 55 ofthe second signal input-output portion 8 into the operating state. Thismakes it possible to output the DATA_OUT_X1 signal from the internalregister 52 to the first external connecting terminal (X1) 2 through thebuffer 54. Further, it is possible to output the DATA_OUT_X2 signal fromthe internal register 52 to the second external connecting terminal (X2)3 through the buffer 55.

The internal register 52 outputs the ENB_OSC signal 64 to the biasstabilization circuit 6. The ENB_OSC signal 64 brings the biasstabilization circuit 6 into the non-operating state. For example, theinternal register 52 outputs a low level signal as the ENB_OSC signal 64to the bias stabilization circuit 6 to bring the bias stabilizationcircuit 6 shown in FIG. 1 into the non-operating state. When the lowlevel signal is supplied to the gate of the NMOS transistor 23, thepull-down resistor 24 and the power supply terminal (the second powersupply terminal) that is supplied with the ground potential VSS aredisconnected. Further, when the low level signal is supplied to theinput side of the inverter 25, the inverter 25 outputs a high levelsignal. Then, the high level signal is supplied to the gate of the PMOStransistor 21, and the pull-up resistor 22 and the power supply terminal(the first power supply terminal) that is supplied with the power supplyvoltage VDD are disconnected. This configuration makes it possible toprevent the signal output from the first external connecting terminal(X1) 2 to the first signal input-output portion 7, or the signal outputfrom the first signal input-output portion 7 to the first externalconnecting terminal (X1) 2, from flowing into the bias stabilizationcircuit 6.

When the semiconductor device according to this exemplary embodiment isused as the signal input-output circuit, a charging current and adischarging current of the coupling capacitor (Cox) 11 increase.However, a capacitance value of the coupling capacitor (Cox) 11, forexample, is about 3 pF, which is nearly equal to a parasiticcapacitance. Therefore, the influence thereof is small.

As mentioned above, when the semiconductor device according to thisexemplary embodiment is used as the signal input-output circuit, theinverting amplifier 4, the buffer 13, and the bias stabilization circuit6 are brought into the non-operating state, and the first signalinput-output portion 7 and the second signal input-output portion 8 arebrought into the operating state. This makes it possible to send theDATA_OUT_X1 signal from the internal register 52 to the first externalconnecting terminal (X1) 2 and to send the DATA_IN_X1 signal from thefirst external connecting terminal (X1) 2 to the internal register 52.Similarly, this makes it possible to send the DATA_OUT_X2 signal fromthe internal register 52 to the second external connecting terminal (X2)3 and to send the DATA_IN_X2 signal from the second external connectingterminal (X2) 3 to the internal register 52. In this case, it ispossible to prevent these signals from flowing into the invertingamplifier 4 or the bias stabilization circuit 6 as a leakage current.This leads to suppression of malfunction due to the output levelfluctuation and reduction in power consumption.

Thus, the semiconductor device according to this exemplary embodiment isconfigured to be capable of being selectively switched between theoscillation circuit and the signal input-output circuit. This makes itpossible to share the signal input-output portion and reduce the numberof input-output terminals. Further, when the semiconductor device isused as the signal input-output circuit, the semiconductor deviceaccording to this exemplary embodiment can prevent signals from flowinginto the inverting amplifier or the bias stabilization circuit as aleakage current, thereby suppressing the occurrence of the malfunctiondue to the output level fluctuation and reducing the power consumption.

Second Exemplary Embodiment

Next, a second exemplary embodiment of the present invention will bedescribed. FIG. 3 is a circuit diagram showing a semiconductor deviceaccording to the second exemplary embodiment. In the semiconductordevice according to this exemplary embodiment, the configurations of thebias stabilization circuit 6 and the electrostatic protection circuit 10are different from those of the first exemplary embodiment. The othercomponents are similar to those of the first exemplary embodiment, andthus a duplicated description will be omitted.

As shown in FIG. 3, the bias stabilization circuit 6 of thesemiconductor device according to this exemplary embodiment includes aPMOS transistor (a fifth transistor) 31, a pull-up resistor (a thirdresistor) 32, and an inverter 33. In the PMOS transistor 31, the sourceis connected to the power supply terminal (the first power supplyterminal) supplied with the power supply voltage VDD, the gate isconnected to an output side of the inverter 33, and the drain isconnected to the pull-up resistor 32. The ENB_OSC signal 64 that bringsthe bias stabilization circuit 6 into an operating state or anon-operating state is supplied to the inverter 33. In thisconfiguration, an output voltage of the bias stabilization circuit 6 isfixed to the power supply voltage VDD and is supplied to the couplingcapacitor (Cox) 11.

In the semiconductor device according to this exemplary embodiment, thepower supply voltage VDD is supplied from the bias stabilization circuit6 as a bias voltage. Therefore, as shown in FIG. 5C, a voltage at thefirst external connecting terminal (X1) 2 of the oscillation circuitoscillates with the power supply voltage VDD as a center. In this case,the voltage value of the oscillation circuit exceeds the power supplyvoltage VDD. When a PMOS transistor is used for the electrostaticprotection circuit 10 and the drain of the PMOS transistor and theoscillation circuit are connected to each other, a forward current flowsinto a parasitic diode between the drain and the back gate. This causesa breakdown or malfunction of the device. Therefore, in thesemiconductor device according to this exemplary embodiment, an NMOStransistor (a sixth transistor) 34 is used for the electrostaticprotection circuit 10. The drain of the NMOS transistor 34 is connectedto the first external connecting terminal (X1) 2, and the gate andsource of the NMOS transistor 34 are connected to the power supplyterminal (the second power supply terminal) supplied with the groundpotential VSS. Further, n-channel open-drain buffers are used as thebuffers 54 and 55 (refer to FIG. 2) that are the buffers for the outputof the first signal input-output portion 7.

In the semiconductor device according to this exemplary embodiment, thepull-down resistor at the bias stabilization circuit 6 can be omitted.Therefore, the circuit area can be reduced. Further, the input impedancecan be increased by reducing the pull-down resistor. This makes itpossible to reduce the resistance value of the pull-up resistor comparedwith that in the first exemplary embodiment. The same advantageouseffects described in the first exemplary embodiment can also be achievedin the semiconductor device according to this exemplary embodiment.

Third Exemplary Embodiment

Next, a third exemplary embodiment of the present invention will bedescribed. FIG. 4 is a circuit diagram showing a semiconductor deviceaccording to the third exemplary embodiment. In the semiconductor deviceaccording to this exemplary embodiment, the configuration of the biasstabilization circuit 6 is different from that of the first exemplaryembodiment. The other components are similar to those of the firstexemplary embodiment, and thus a duplicated description will be omitted.

As shown in FIG. 4, the bias stabilization circuit 6 in thesemiconductor device according to this exemplary embodiment includes aPMOS transistor (a seventh transistor) 41, a pull-up resistor (a fourthresistor) 42, and an inverter 43. In the PMOS transistor 41, the sourceis connected to a power supply terminal (a third power supply terminal)supplied with a power supply voltage VDD2, the gate is connected to anoutput side of the inverter 43, and the drain is connected to thepull-up resistor 42. The ENB_OSC signal 64 that brings the biasstabilization circuit 6 into an operating state or a non-operating stateis supplied to the inverter 43. In this configuration, an output voltageof the bias stabilization circuit 6 is fixed to the power supply voltageVDD2 and is supplied to the coupling capacitor (Cox) 11.

In the semiconductor device according to this exemplary embodiment, thepower supply voltage VDD2 is supplied from the bias stabilizationcircuit 6 as a bias voltage. Therefore, as shown in FIG. 5D, a voltageat the first external connecting terminal (X1) 2 of the oscillationcircuit oscillates with the power supply voltage VDD2 as a center. Inthis case, if a value of VDD satisfies VDD≧VDD2+0.5×(a value ofamplitude of oscillation), output buffers using CMOS may be used for thebuffers 54 and 55 (refer to FIG. 2) that are the buffers for the outputof the first signal input-output portion 7. In this case, a system withtwo power supplies is needed. However, many of the recentgeneral-purpose ICs have low-voltage power supplies to reduce the powerconsumption of logic circuits such as a CPU.

In the semiconductor device according to this exemplary embodiment, thepull-down resistor at the bias stabilization circuit 6 can be omitted.Therefore, the circuit area can be reduced. Further, a maximum voltagevalue at the first external connecting terminal (X1) 2 can be less orequal to the power supply voltage VDD by using the low-voltage powersupply VDD2 the voltage value of which is less than that of the powersupply voltage VDD. Therefore, the output buffers using CMOS can be usedas the buffers 54 and 55 that are the buffers for the output of thefirst signal input-output portion 7. The same advantageous effectsdescribed in the first exemplary embodiment can be also achieved in thesemiconductor device according to this exemplary embodiment.

The first to third exemplary embodiments can be combined as desirable byone of ordinary skill in the art.

While the invention has been described in terms of several exemplaryembodiments, those skilled in the art will recognize that the inventioncan be practiced with various modifications within the spirit and scopeof the appended claims and the invention is not limited to the examplesdescribed above.

Further, the scope of the claims is not limited by the exemplaryembodiments described above.

Furthermore, it is noted that, Applicant's intent is to encompassequivalents of all claim elements, even if amended later duringprosecution.

1. A semiconductor device capable of being selectively switched betweenan oscillation circuit and a signal input-output circuit, comprising:first and second external connecting terminals that are connectable toan oscillation device; an inverting amplifier, an input side of theinverting amplifier being electrically connected to the first externalconnecting terminal through a coupling capacitor, an output side of theinverting amplifier being electrically connected to the second externalconnecting terminal; a feedback resistor connected to the input side andthe output side of the inverting amplifier; a bias stabilization circuitthat stabilizes a bias applied to the coupling capacitor; a first signalinput-output portion connected to the first external connectingterminal; and a second signal input-output portion connected to thesecond external connecting terminal, wherein when the semiconductordevice is used as the oscillation circuit, the inverting amplifier andthe bias stabilization circuit are brought into an operating state andthe first and second signal input-output portions are brought into anon-operating state, and when the semiconductor device is used as thesignal input-output circuit, the inverting amplifier and the biasstabilization circuit are brought into the non-operating state and thefirst and second signal input-output portions are brought into theoperating state.
 2. The semiconductor device according to claim 1,wherein the output side of the inverting amplifier is brought into ahigh impedance state when the semiconductor device is used as the signalinput-output circuit.
 3. The semiconductor device according to claim 1,further comprising an electrostatic protection circuit connected to thefirst external connecting terminal.
 4. The semiconductor deviceaccording to claim 1, wherein the bias stabilization circuit includes: afirst resistor having one end connected to a first power supply terminalthrough a first transistor and the other end electrically connected tothe coupling capacitor; and a second resistor having one end connectedto a second power supply terminal through a second transistor and theother end electrically connected to the coupling capacitor, when thesemiconductor device is used as the oscillation circuit, the first andsecond transistors are turned on, and when the semiconductor device isused as the signal input-output circuit, the first and secondtransistors are turned off.
 5. The semiconductor device according toclaim 4, wherein the electrostatic protection circuit includes: a thirdtransistor having a gate and a drain connected to the first power supplyterminal and a source connected to the first external connectingterminal; and a fourth transistor having a drain connected to the firstexternal connecting terminal and a gate and a source connected to thesecond power supply terminal.
 6. The semiconductor device according toclaim 1, wherein the bias stabilization circuit includes a thirdresistor having one end connected to a first power supply terminalthrough a fifth transistor and the other end electrically connected tothe coupling capacitor, when the semiconductor device is used as theoscillation circuit, the fifth transistor is turned on, when thesemiconductor device is used as the signal input-output circuit, thefifth transistor is turned off.
 7. The semiconductor device according toclaim 6, wherein the electrostatic protection circuit includes a sixthtransistor having a drain connected to the first external connectingterminal and a gate and a source connected to a second power supplyterminal.
 8. The semiconductor device according to claim 1, wherein thebias stabilization circuit includes a fourth resistor having one endconnected to a third power supply terminal through a seventh transistorand the other end electrically connected to the coupling capacitor, whenthe semiconductor device is used as the oscillation circuit, the seventhtransistor is turned on, and when the semiconductor device is used asthe signal input-output circuit, the seventh transistor is turned off.9. The semiconductor device according to claim 8, wherein a voltagevalue of the third power supply terminal is set to satisfyVDD≧VDD2+0.5×(a value of amplitude of oscillation at the first externalconnecting terminal), where VDD is a voltage value of the first powersupply terminal and VDD2 is the voltage value of the third power supplyterminal.
 10. The semiconductor device according to claim 1, wherein thecoupling capacitor is configured by a gate capacitor.
 11. Thesemiconductor device according to claim 1, wherein the feedback resistorhas a resistance value in a range of 10 MΩ to 20 MΩ.
 12. A method forcontrolling a semiconductor device capable of being selectively switchedbetween an oscillation circuit and a signal input-output circuit, thesemiconductor device comprising: first and second external connectingterminals that are connectable to an oscillation device; an invertingamplifier, an input side of the inverting amplifier being electricallyconnected to the first external connecting terminal through a couplingcapacitor, an output side of the inverting amplifier being electricallyconnected to the second external connecting terminal; a feedbackresistor connected to the input side and the output side of theinverting amplifier; a bias stabilization circuit that stabilizes a biasapplied to the coupling capacitor; a first signal input-output portionconnected to the first external connecting terminal; and a second signalinput-output portion connected to the second external connectingterminal, the method comprising: bringing the inverting amplifier andthe bias stabilization circuit into an operating state and bringing thefirst and second signal input-output portions into a non-operating statewhen the semiconductor device is used as the oscillation circuit, andbringing the inverting amplifier and the bias stabilization circuit intothe non-operating state and bringing the first and second signalinput-output portions into the operating state when the semiconductordevice is used as the signal input-output circuit.
 13. The method forcontrolling the semiconductor device according to claim 12, wherein theoutput side of the inverting amplifier is brought into a high impedancestate when the semiconductor device is used as the signal input-outputcircuit.